<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/12/8 0008
 * Time: 下午 10:22
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

/**
 * HelloWorld Model
 *
 * @since  0.0.1
 * allModeEvery
 */
class ZsfieldModelZsfield1 extends JModelItem
{
    /**
     * @var string message
     */
    protected $message;

    /**
     * Get the message
     *
     * @return  string  The message to be displayed to the user
     */
    public function getMsg($id = 1)
    {
        if (!is_array($this->message))
        {
            $this->message = array();
        }

        if (!isset($this->message[$id]))
        {
            // Request the selected id
            $jinput = JFactory::getApplication()->input;
            $id     = $jinput->get('id',1,'INT');

            // Get a TableHelloWorld instance
            $table = $this->getTable();

            // Load the message
            $table->load($id);

            // Assign the message
            $this->message[$id] = $table->value;
        }

        return $this->message[$id];
    }

    public function getTable($type = 'zsfield', $prefix = 'zsfieldTable', $config = array())
    {
        return JTable::getInstance($type, $prefix, $config);
    }
}